import { ToolTipItem } from "../../../../com/mui/manager/ToolTipItem";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { DisplayUtil } from "../../../common/DisplayUtil";
import { GImageBitmap } from "../../../../com/mui/controls/GImageBitmap";
import { Language } from "../../../../extend/language/Language";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
type int = number;
//class ChunlianWordItem
    
    export  class ChunlianWordItem extends ToolTipItem
    {
        constructor(arg1: Boolean)
        {
            super();
            this._tft = new GTextFormat(FontUtil.stXingkaiName, 28, 15788607, true);
            this.init();
            this._isEnableTip = arg1;
            if (this._isEnableTip) 
            {
                this.buttonMode = true;
                this.useHandCursor = true;
            }
            return;
        }

        /* internal  */init(): void
        {
            ObjCreate.createBitmap(ImagesConst.RedMini, 0, 0, this);
            this._fengSprite = new Object /* flash.display.Sprite */();
            this._fengSprite.mouseEnabled = false;
            this._fengSprite.mouseChildren = false;
            this._fengSprite.x = 4;
            this._fengSprite.y = 4;
            this.addChild(this._fengSprite);
            this._wordTxt = ObjCreate.createGTextField("", 0, 7, 41, 38, this, this._tft);
            this._wordTxt.autoSize = flash.text.TextFieldAutoSize.CENTER;
            this._wordTxt.mouseEnabled = false;
            return;
        }

        public get word(): string
        {
            return this._word;
        }

        public set word(arg1: string)
        {
            this._word = arg1;
            this._wordTxt.text = arg1;
            return;
        }

        public set isEnable(arg1: Boolean)
        {
            if (arg1) 
            {
                DisplayUtil.removeMe(this._fengBitmap);
            }
            else 
            {
                if (!this._fengBitmap) 
                {
                    this._fengBitmap = new GImageBitmap("CLWordUnable.png");
                }
                if (!this._fengSprite.contains(this._fengBitmap)) 
                {
                    this._fengSprite.addChild(this._fengBitmap);
                }
            }
            return;
        }

        public /* override */ get toolTipData()
        {
            if (this._isEnableTip) 
            {
                return Language.getString(58006);
            }
            return null;
        }

        /* internal */ /* var */_wordTxt: GTextFiled;

        /* internal */ /* var */_fengBitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_fengSprite: Object /* flash.display.Sprite */;

        public /* var */index: int;

        /* internal */ /* var */_word: string;

        /* internal */ /* var */_tft: GTextFormat;

        /* internal */ /* var */_isEnableTip: Boolean;
    }
